<template>
  <n-layout has-sider class="containers">
    <n-layout-sider class="sider" width="400px">
      <car-tree-select
        needCarHeader
        needCheckMode
        @check="onCarSelect"
        @onSelect="onCarClick"
        @submit="onSubmit"
      >
        <template #form>
          <n-form
            :label-col="{ style: 'margin-right: 4px' }"
            :wrapper-col="{ style: 'flex: 1;' }"
            label-placement="left"
            :form="form"
            @submit="onSubmit"
          >
            <n-form-item
              :show-feedback="false"
              style="margin-bottom: 2px !important"
              label="快速选择："
            >
              <n-button @click="changeStartDays(1)" size="tiny" type=""> 前一天 </n-button>
              <n-button @click="changeStartDays(3)" size="tiny" type=""> 前三天 </n-button>
              <n-button @click="changeStartDays(7)" size="tiny" type=""> 前七天 </n-button>
            </n-form-item>
            <n-form-item
              :show-feedback="false"
              style="margin-bottom: 2px !important"
              label="过滤条件："
            >
              <a-select
                mode="multiple"
                placeholder="请选择过滤条件"
                style="width: 100%; font-size: 12px"
                @change="handleFilterChange"
              >
                <a-select-option key="isHasSpeed"> 速度大于0 </a-select-option>
                <a-select-option key="isLocationValid"> 定位有效 </a-select-option>
                <a-select-option key="precision-3"> 精确一(3位) </a-select-option>
                <a-select-option key="precision-4"> 精确一(4位) </a-select-option>
                <a-select-option key="precision-5"> 精确一(5位) </a-select-option>
                <a-select-option key="noRepeat"> 过滤重复点 </a-select-option>
              </a-select>
            </n-form-item>
            <n-form-item
              :show-feedback="false"
              style="margin-bottom: 2px !important"
              label="开始时间："
            >
              <n-date-picker
                style="width: 100%"
                :show-time="{ format: 'HH:mm:ss' }"
                format="YYYY-MM-DD HH:mm:ss"
                placeholder="开始时间"
              />
            </n-form-item>
            <n-form-item
              :show-feedback="false"
              style="margin-bottom: 12px !important"
              label="结束时间："
            >
              <n-date-picker
                style="width: 100%"
                :show-time="{ format: 'HH:mm:ss' }"
                format="YYYY-MM-DD HH:mm:ss"
                placeholder="结束时间"
              />
            </n-form-item>
            <n-button type="primary" htmlType="submit" class="submit-button" :loading="isLoading">
              查询
            </n-button>
          </n-form>
        </template>
      </car-tree-select>
    </n-layout-sider>
    <!-- <n-layout-header></n-layout-header> -->
    <n-layout-content
      style="position: relative; position: relative; display: flex; flex-direction: column"
    >
      <WxMap />
      <!-- <div style="flex: 1" id="bd-map"></div> -->
      <car-progress
        @onStop="onStop"
        @onCarProgress="onCarProgress"
        :lineData="lineData"
        ref="carProgress"
        :tableList="gpsList"
      />
    </n-layout-content>
  </n-layout>
</template>

<script>
  import './Lists.less';
  import { defineComponent } from 'vue';
  import WxMap from '@/components/WxMap/WxMap.vue';
  import CarTreeSelect from '@/components/CarTreeSelect/CarTreeSelect.vue';
  export default defineComponent({
    components: {
      WxMap,
      CarTreeSelect,
    },
    setup: () => {},
  });
</script>

<style>
  /* .ant-pro-basicLayout-content{
  margin: 0 !important;
} */
</style>

<style lang="less" scoped>
  /deep/ .ant-table {
    font-size: 12px !important;
  }
  /deep/ .ant-form-item-label {
    text-align: left;
  }
  /deep/ .ant-form-item-label label {
    font-size: 12px !important;
    margin-right: 2px !important;
  }
  .star-checkbox /deep/ span {
    vertical-align: bottom;
  }
  .map-search-container {
    background-color: white;
    width: 200px;
    height: 44px;
    position: absolute;
    top: 12px;
    left: 16px;
    z-index: 2;
    /deep/ .ant-input {
      height: 44px;
      line-height: 44px;
      font-size: 12px;
      border-right: none !important;
      border: none;
    }
    /deep/ .ant-input-group-addon {
      cursor: pointer;
      border: none;
      background-color: inherit;
      // padding: 15px 13px !important;
      box-sizing: border-box;
    }
  }
  .map-toolbar-container {
    height: 44px;
    line-height: 44px;
    overflow: hidden;
    position: absolute;
    top: 10px;
    right: 24px;
    min-width: 498px;
    background-color: white;
    z-index: 2;
    display: flex;
    .map-toolbar-item {
      min-width: 75px;
      height: 44px;
      font-size: 12px;
      color: #333;
      line-height: 44px;
      cursor: pointer;
      display: flex;
      align-items: center;
      padding: 10px 8px;
      box-sizing: border-box;
      position: relative;
    }
    .map-toolbar-item:nth-child(n + 3)::before {
      content: ' ';
      position: absolute;
      left: 0;
      top: 50%;
      bottom: 50%;
      transform: translateX(-50%) translateY(-50%);
      width: 1px;
      height: 18px;
      background-color: #eee;
    }
    .map-toolbar-item:last-child::before {
      content: none;
    }
    // .map-toolbar-item::before{
    // }
    // .map-toolbar-item{
    //   border-left: 1px solid #eee;
    // }
  }
  /deep/ .ant-input {
    font-size: 12px;
  }
  /deep/ .ant-checkbox-wrapper {
    display: flex;
    align-items: center;
    line-height: 20px;
  }
  /deep/ .ant-checkbox {
    top: unset !important;
  }
  /deep/ .ant-checkbox-inner {
    width: 12px;
    height: 12px;
  }
</style>
